﻿namespace PoemGame.Query
{
    /// <summary>
    /// 游戏查询接口
    /// </summary>
    public interface IGameQuery
    {
        /// <summary>
        /// 根据Id获取游戏
        /// </summary>
        /// <param name="gameId"></param>
        /// <returns></returns>
        Task<GameRes?> GetGameResAsync(Guid gameId);
        /// <summary>
        /// 根据查询条件获取游戏
        /// </summary>
        /// <param name="wherecondition">条件的where表达式</param>
        /// <returns></returns>
        Task<IEnumerable<GameRes>> GetGamesByConditionAsync(
            string wherecondition);
        /// <summary>
        /// 根据查询条件获取游戏
        /// </summary>
        /// <param name="pageindex">起始页从1开始</param>
        /// <param name="pagesize">每页记录数</param>
        /// <param name="wherecondition">条件的where表达式</param>
        /// <param name="orderby">排序字段</param>
        /// <returns></returns>
        Task<IEnumerable<GameRes>> GetPagedGamesByConditionAsync(
            int pageindex,
            int pagesize, 
            string wherecondition, 
            string orderby);
        /// <summary>
        /// 符合条件的记录数
        /// </summary>
        /// <param name="wherecondition"></param>
        /// <returns></returns>
        Task<long> GetGamesCountByConditionAsync(
            string wherecondition);

    }
}